package javaBase.chapter02;

import java.util.Scanner;

/**
 * Salary 薪水
 * Calculator 计算器
 */
public class SalaryCalculator {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        boolean continueFlag = true;

        while (continueFlag) {
            System.out.println("请输入月薪：");
            double monthlySalary = scanner.nextDouble();
            System.out.println("请输入每年工作月数：");
            int monthsPerYear = scanner.nextInt();

            double annualSalary = monthlySalary * monthsPerYear;
            System.out.println("你的年薪是：" + annualSalary);

            if (annualSalary > 100000) {
                System.out.println("恭喜你超越90%的国人");
            } else if (annualSalary > 200000) {
                System.out.println("恭喜你超越98%的国人");
            }

            System.out.println("请输入一个数字（输入88退出程序，输入66重新开始计算）：");
            int input = scanner.nextInt();

            if (input == 88) {
                continueFlag = false;
            } else if (input == 66) {
                continue;
            }
        }

        scanner.close();
    }
}
